﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// System_TableRelation数据模型对象
    /// </summary>
    [Serializable]
    public partial class System_TableRelationMod
    {
        /// <summary>
        /// 初始化System_TableRelation数据模型对象
        /// </summary>
        public System_TableRelationMod()
        {
            
        }
        /// <summary>
        /// 初始化System_TableRelation数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="iD">ID</param>
        /// <param name="table1">Table1</param>
        /// <param name="table2">Table2</param>
        /// <param name="relations">Relations</param>
        public System_TableRelationMod(long iD,string table1,string table2,string relations)
        {
            //给ID字段赋值
            this.ID = iD;
            //给Table1字段赋值
            this.Table1 = table1;
            //给Table2字段赋值
            this.Table2 = table2;
            //给Relations字段赋值
            this.Relations = relations;
        }
        
		//属性存储数据的变量
        private long _iD;
        private string _table1;
        private string _table2;
        private string _relations;
        
        /// <summary>
        /// ID
        /// </summary>
        public long ID
        {
            get { return this._iD; }
            set { this._iD = value; }
        }
        /// <summary>
        /// Table1
        /// </summary>
        public string Table1
        {
            get { return this._table1; }
            set { this._table1 = value; }
        }
        /// <summary>
        /// Table2
        /// </summary>
        public string Table2
        {
            get { return this._table2; }
            set { this._table2 = value; }
        }
        /// <summary>
        /// Relations
        /// </summary>
        public string Relations
        {
            get { return this._relations; }
            set { this._relations = value; }
        }
        
        /// <summary>
        /// 对比两个System_TableRelation数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的System_TableRelation数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成System_TableRelation数据模型对象
            System_TableRelationMod system_TableRelationMod = obj as System_TableRelationMod;
            //判断是否转换成功
            if (system_TableRelationMod == null) return false;
            //进行匹配属性的值
            return
                //判断ID是否一致
                this.ID == system_TableRelationMod.ID &&
                //判断Table1是否一致
                this.Table1 == system_TableRelationMod.Table1 &&
                //判断Table2是否一致
                this.Table2 == system_TableRelationMod.Table2 &&
                //判断Relations是否一致
                this.Relations == system_TableRelationMod.Relations;
        }
        /// <summary>
        /// 将当前System_TableRelation数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将System_TableRelation数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将ID进行按位异或运算处理
                this.ID.GetHashCode() ^
                //将Table1进行按位异或运算处理
                (this.Table1 == null ? 2147483647 : this.Table1.GetHashCode()) ^
                //将Table2进行按位异或运算处理
                (this.Table2 == null ? 2147483647 : this.Table2.GetHashCode()) ^
                //将Relations进行按位异或运算处理
                (this.Relations == null ? 2147483647 : this.Relations.GetHashCode());
        }
        /// <summary>
        /// 将当前System_TableRelation数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前System_TableRelation数据模型对象转换成字符串副本
            return
                "[" +
                //将ID转换成字符串
                this.ID + "," +
                //将Table1转换成字符串
                this.Table1 + "," +
                //将Table2转换成字符串
                this.Table2 + "," +
                //将Relations转换成字符串
                this.Relations +
                "]";
        }
    }
}
